//TODO
function catcalc(cal) {
    var date = cal.date;
    var time = date.getTime()
    // use the _other_ field
    var field = document.getElementById("f_calcdate");
    if (field == cal.params.inputField) {
        field = document.getElementById("f_date_a");
        time -= Date.WEEK; // substract one week
    } else {
        time += Date.WEEK; // add one week
    }
    var date2 = new Date(time);
    field.value = date2.print("%Y-%m-%d %H:%M");
}
Calendar.setup({
    inputField : "f_date_a", // id of the input field
    ifFormat : "%Y-%m-%d %H:%M", // format of the input field
    showsTime : true,
    timeFormat : "24",
    onUpdate : catcalc
});
Calendar.setup({
    inputField : "f_calcdate",
    ifFormat : "%Y-%m-%d %H:%M",
    showsTime : true,
    timeFormat : "24",
    onUpdate : catcalc
});
